import "package:flutter/material.dart";

class SearchPage extends StatefulWidget {
  const SearchPage({super.key});

  @override
  State<SearchPage> createState() => SearchPageState();
}

class SearchPageState extends State<SearchPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('搜索页')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
                onPressed: () {
                  Navigator.pop(context); //返回上一页
                },
                child: const Text('点击返回上一页')),
            ElevatedButton(
                onPressed: () {
                  Navigator.pushNamed(context, "/form", arguments: {
                    'params1': "参数1",
                    'params2': "参数2",
                  });
                },
                child: const Text('命名式导航跳转到/formPage'))
          ],
        ),
      ),
    );
  }
}
